const express = require('express');
const router = express.Router();
const systemController = require('../controllers/systemController');
const { asyncHandler } = require('../middleware/error');

// 系统维护配置
router.get('/maintenance', asyncHandler(systemController.getMaintenanceConfig));
router.put('/maintenance', asyncHandler(systemController.updateMaintenanceConfig));

// 系统基础配置
router.get('/basic', asyncHandler(systemController.getBasicConfig));
router.put('/basic', asyncHandler(systemController.updateBasicConfig));

// 邮件配置
router.get('/mail-config', asyncHandler(systemController.getMailConfig));
router.put('/mail-config', asyncHandler(systemController.updateMailConfig));
router.post('/mail-test', asyncHandler(systemController.testMailSend));

// 短信配置
router.get('/sms-config', asyncHandler(systemController.getSmsConfig))
router.put('/sms-config', asyncHandler(systemController.updateSmsConfig))
router.post('/sms-test', asyncHandler(systemController.testSmsSend))

// 存储配置
router.get('/storage-config', asyncHandler(systemController.getStorageConfig))
router.put('/storage-config', asyncHandler(systemController.updateStorageConfig))
router.post('/storage-test', asyncHandler(systemController.testStorageConnection))

module.exports = router; 